#设置elasticsearch密码
elastic="fangzq" #6个字符长
kibana='pkibana'
logstash_system='logstash'
beats_system='beats_system'
remote_monitoring_user='remote_user'
/usr/bin/expect <<EOF
spawn docker exec -it es01 bash
send "bin/elasticsearch-setup-passwords interactive\r"
expect {
	"continue" {send "y\r";exp_continue}
	"Enter" {send "${elastic}\r";exp_continue}
	"Reenter" {send "${elastic}\r";exp_continue}
	"Enter" {send "${kibana}\r";exp_continue}
	"Reenter" {send "${kibana}\r";exp_continue}
	"Enter" {send "${logstash_system}\r";exp_continue}
	"Reenter" {send "${logstash_system}\r";exp_continue}
	"Enter" {send "${beats_system}\r";exp_continue}
	"Reenter" {send "${beats_system}\r";exp_continue}
	"Enter" {send "${remote_monitoring_user}\r";exp_continue}
	"Reenter" {send "${remote_monitoring_user}\r";exp_continue}
}
expect eof
EOF
